<?php
  
     /*
      * Following code will create a new row
      * All details are read from HTTP Post Request
      */
      
     // array for JSON response
     $response = array();
      
     // check for required fields
     if (isset($_POST['place_id'])) {
      
         $place_id = $_POST['place_id'];
		 (int)$place_id;
      
         // include db connect class
         require_once __DIR__ . '/db_connect.php';
      
         // connecting to db
         $db = new DB_CONNECT();
      
         // mysql deleting a new row
         $result = mysql_query("DELETE FROM `detail_space_place` WHERE `place_id` = '$place_id'");
      
         // check if row delete or not
         if ($result) {
             // successfully delete into database
             $response["success"] = 1;
             $response["message"] = "Delete successfully created.";
      
             // echoing JSON response
             echo json_encode($response);
         } else {
             // failed to delete row
             $response["success"] = 0;
             $response["message"] = "Oops! An error occurred.";
      
             // echoing JSON response
             echo json_encode($response);
         }
     } else {
         // required field is missing
         $response["success"] = 0;
         $response["message"] = "Required field(s) is missing";
      
         // echoing JSON response
         echo json_encode($response);
     }
 ?>